{% extends "base.html" %}
{% load thumbnail %}
{% load textja %}

{% block content %}
    {% if links %}
        <p class="p_person">
        {% for link in links %}
            &laquo; <a href="{{ link.url }}">{{ link.name }}</a>
        {% endfor %}
        </p>
    {% endif %}
    
    {% if navi_funcs %}
        <ul class="ul_navi_func">
        {% for func in navi_funcs %}
            <li class="{% if forloop.last %}li02{% else %}li01{% endif %}">
                <a href="{{ func.url }}">{{ func.name }}</a></li>
        {% endfor %}
        </ul>
    {% endif %}
    
    <div class="div_alpha09">
    <h2 class="h2_alpha01">{{ title }}</h2>
    <div class="div_alpha09_inner">
    <div class="div01">
    
    {% for recipe in page_obj.object_list %}
        <dl class="dl01">
        <dt><a href="{% url recipes-show recipe_id=recipe.id %}">{{ recipe.name }}</a></dt>
        <dd class="dd01"><a href="{% url recipes-show recipe_id=recipe.id %}">
            {% if recipe.photo %}<img src="{{ recipe.photo|thumbnail:"104x104" }}" alt="{{ recipe.name }}" /></a>{% endif %}</dd>
        <dd class="dd02">by <a href="{% url recipes-users-show user_id=recipe.user_id %}">{{ recipe.user.first_name }}</a> さん</dd>
        <dd class="dd03"><span style="font-weight:bold">コメント</span>: {{ recipe.num_moderated_comments }}</dd>
        <dd class="dd04"><span style="font-weight:bold">投票</span>: {{ recipe.score }}</dd>
        <dd class="dd05">
        {% if recipe.is_awarded %}
            {% if recipe.contest.is_really_finished %}
                <img style="float:left;margin-right:5px" src="/site_media/images/common/icon_awardedstatus.jpg" />
            {% endif %}
        {% endif %}
        {{ recipe.introduction|abbr:25 }}</dd>
        <dd class="dd06"><span style="font-weight:bold">材料</span>: {{ recipe.ingredient_names_str }}</dd>
        <dd class="dd07">
        {% if recipe.contest %}
            <span style="font-weight:bold">お題への応募</span>: 
            <a href="{% url recipes-contests-show contest_id=recipe.contest_id %}">{{ recipe.contest.name }}</a>
        {% endif %}
        </dd>
        <dd class="dd09"><span style="font-weight:bold">公開</span>: {{ recipe.published_at|date:"Y/n/j" }}</dd>
        <!-- /dl03 --></dl>
    {% endfor %}
    
    </div>
    </div>
    </div>

    {% include "paginator.html" %}
    
{% endblock %}
